home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / rpg / crossfir.92 / crossfir / crossfire-0.92.5 / doc / crossfire.doc < prev    next >
Text File  |  1996-07-24  |  34KB  |  809 lines

  1. This files so far only concernes how to make archetypes,treasure and NPC's.
  2.  
  3. The name in parantheses is the name as it should be used in the archetype
  4. file.
  5. ===========================================================================
  6.  
  7. Types (type):
  8.  
  9. Specified in defines.h.  It is used to group items together.  A type only
  10. needs to be added for a new archetype if in some area of the program,
  11. it is actually used.
  12.  
  13.  For example, if adding a new monster, there is no need to add a new type
  14. in defines.h if crossfire never checks the type element in the object
  15. structure for that new type.
  16.  
  17.  Most types are set for items that are applied, items that have special
  18. properties.
  19.  
  20. ------------------------------------------------------------------------------
  21.  
  22. Attack types (attacktype):
  23.  
  24. Physical         1
  25. Magic             2
  26. Fire             4
  27. Electricity         8
  28. Cold            16
  29. Confusion        32
  30. Acid            64  Damages players equipment
  31. Drain           128
  32. Weaponmagic       256  (Special, use with care)
  33. Ghosthit       512  (Attacker dissolves)
  34. Poison          1024
  35. Slow          2048
  36. Paralyze      4096
  37. Turn undead      8192  
  38. Fear         16384
  39. Cancellation     32768
  40. Depletion     65536
  41. Death        131072
  42. Chaos        262144
  43. Counterspell    524288
  44. Godpower       1048576 (Special, only for use by priest spells)
  45.  
  46. Note that one archetype can have multiple attack types by adding
  47. these values together.  Thus, something with an attacktype of 65
  48. would attack with both acid and physical.
  49.  
  50. Immunity (immune), Protection (protected), and Vulnerable (vulnerable)
  51. also use these values.  A creature that is immune will take no damage
  52. from that type, a protected creature takes half damage, and a vulnerable
  53. creature takes double damage.
  54.  
  55. A few notes:  If a creature/object is immune to magic, then it will be 
  56. immune to all damage from that attack, even if that attack type contains
  57. more than just magic.
  58.  
  59.  Otherwise, a creature needs to be immune to all attack types in order
  60. to take no damage (thus, a creature that is immune to physical, but
  61. getting hit by a weapon that does physical and fire would take normal
  62. damage).
  63.  
  64.  If an object is protected/vulnerable to just one of the attack types,
  65. then the damage will be adjusted accordingly.  Thus, an object that
  66. attacks with physical and fire will do half damage if the creature is
  67. protected from either/both physical or fire.
  68.  
  69.  Note that if the attack type is physical, then damage can be reduced by the
  70. creatures armor.
  71.  
  72. ------------------------------------------------------------------------------
  73.  
  74. Material types (material):
  75.  
  76. Paper      1
  77. Iron      2
  78. Glass      4
  79. Leather      8
  80. Wood     16
  81. Organic     32
  82. Stone     64
  83. Cloth    128
  84. Adamantite 256
  85.  
  86. ------------------------------------------------------------------------------
  87. Pick Up specifiers (defined with pick_up)
  88.  
  89. Nothing          1
  90. Wealth             2
  91. Food             4
  92. Weapon             8
  93. Armour            16
  94. All but those defined    32
  95. All            64
  96.  
  97. Note also that if can_use_armor, can_use_weapon, can_use_ring,
  98. can_use_wand, can_cast_spell, can_use_bow are set, then the creature
  99. will pick up the matching items even if the pick_up element is not
  100. set to pick up those items.
  101.  
  102. This only applies to monsters.  The player pickup method is much different.
  103.  
  104. ------------------------------------------------------------------------------
  105.  
  106.  
  107. Will_apply specifiers (will_apply):
  108.    1    -       Handles
  109.    2    -    Treasure (chests)
  110.    4    -       Earthwall (tear down)
  111.    8    -       Door      (open) */
  112.  
  113. ------------------------------------------------------------------------------
  114.  
  115. Meaning of editable field (editable):
  116.  
  117. Editable sole meaning is for crossedit.  Crossedit uses editable to determine
  118. what menu(s) the item should appear in.  Crossfire does not use it at all.
  119.  
  120. The following table/values determine what menus the archetype will appear
  121. in.  When looking at this table to determine what the value of editable
  122. should be, it is 2^(num-1).  That is to say if you want it to appear in the
  123. 'shop' menu, it would be 2^6 and not 2^7.
  124.  
  125. Asterisk(*) marks groups that are really editable.
  126.  
  127.  0 (0)    None            - Internal archetypes (spells, abilities,
  128.                 map, etc.)
  129. *1 (1)    Monsters        - all monsters, generators and NPC's
  130. *2 (2)    Exits            - all buildings, towns, teleprorts and other
  131.                 exits
  132. *3 (4)    Treasures        - Normally used maps as treasures
  133. *4 (8)    Backgrounds        - different backgrounds (floors, woods, etc.)
  134. *5 (16) Gates and door        - everything that can be opened or closed 
  135. *6 (32) Special            - directors, spinners, firewalls 
  136. *7 (64) Shop            - All items needed in shops.
  137. *8 (128) Normal objects        - sacks, signs, gravestone, furnitures etc.
  138. *9 (256) False walls        - Walls that can be destroyed or
  139.                 broken through.
  140. 10 (512) Walls            - different walls, caves, dungeons etc.
  141. 11 (1024) Equipments        - mainly weapons and armours
  142. 12 (2048) Rest treasures    - foods, scrolls, potions, jewels, etc
  143. 13 (4096) Artifacts        - Named weapons, special armors, etc
  144.  
  145. An archetype can belong to several editable families, by adding the values
  146. together.  For example, a value of 544 (512+32) would show up in both the
  147. special and walls menu.
  148.  
  149. ------------------------------------------------------------------------------
  150. Damage (applies to both players and monsters)
  151.  
  152.  Damage determines the amount of damage the creature does.  The form this
  153. damage takes it determined by the attacktype the creature has.
  154.  
  155.  When determining damage, a number between 1 and the damage value is
  156. rolled.  Thus, even if you have a +6 damage bonus from strength, magic
  157. weapons, etc, a value of 1 could still be generated.  Thus, even with very
  158. high magical monsters or very high strength monsters, a low damage roll can
  159. result some of the time.
  160.  
  161. ------------------------------------------------------------------------------
  162. Meaning of certain attributes for certain items:
  163.  
  164. All objects have strength, intelligence, wisdom, dexterity, constitution,
  165. charisma, experience, and spell points.  However, how each is used
  166. varies for different objects.  Here is a PARTIAL rundown:
  167.  
  168. For rings, str, int, wis, dex, con and cha are modifiers to the users
  169. abilities.
  170.  
  171. For treasures (chests, random_???), hp is the number of items that
  172. should be generated.  A chest with hp of 5 will generate 5 treasures,
  173. a random_scroll space with hp of 5 will generate 5 random scroll types (of
  174. which, each scroll type may number more than one - see the treasures
  175. file for more information.
  176.  
  177. For shop floors and treasures, exp is the difficulty to use for
  178. creating the treasure.  If exp is 0 (which it is by default), then the
  179. map difficulty is used instead.
  180.  
  181. For armour, last_sp (ARMOR_SPEED) is the maximum speed that the
  182. character can have while wearing that armor.
  183.  
  184. For armour, last_heal determines the penalty for spell point regeneration.
  185.  
  186. For exits:
  187. slaying  = The map which the exit leads to.
  188. hp,sp = (x,y) of the destination on the new map.
  189.  
  190. ------------------------------------------------------------------------------
  191. SPECIAL NOTES FOR CERTAIN OBJECTS:
  192. ------------------------------------------------------------------------------
  193.  
  194. MAPS:
  195.  
  196. 'value' stores the timeout
  197. 'weight' stores the reset time.  
  198. 'level' stores the map difficulty.
  199. 'stand_still'    If nonzero, the map reset time will not be updated
  200.     when someone enters/exits the map.  Thus, once the map has
  201.     been loaded, it will reset in 'reset time' no matter what
  202.     access happen.  This is useful for shops and towns, which
  203.     are constantly accessed, but should be reset periodically.
  204.  
  205. All three of these values are used when loading the map.  Internally,
  206. fields in the map structure are used for some of these, or are
  207. assigned some of these values when they get scheduled for saving.
  208.  
  209. Note that crossedit has a nice menu that lists outside values and maps
  210. them to the internal values - thus, you seldom need to know these unless
  211. you are trying to debug something.
  212.  
  213. ------------------------------------------------------------------------------
  214. CONVERTERS:
  215.  
  216. other_arch = which archetype to convert into
  217. slaying    = which archetype to convert from
  218. sp         = how many other_arch to create
  219. food       = how many items are needed to convert into <sp> other_arch
  220.  
  221. ------------------------------------------------------------------------------
  222.  
  223. BOWS & ARROWS:
  224.  
  225. Missile weapons
  226.  
  227. Missile weapons (type BOW) can be used to shoot missiles
  228. (type ARROW). The most common wepons are bows and crossbows
  229. but other weapons are also easy to implement (e.g. a sling).
  230. The following variables have the same meaning for both weapons
  231. and bullets:
  232.  
  233. race    type of missile (indentifies weapon and missile pairs)
  234. dam    the basic damage
  235. wc    the basic wc
  236. magic    the magic bonus
  237.  
  238. And these two used only for arrows.
  239.  
  240. hp    the basic damage (internal use)
  241. sp    the basic wc (internal use)
  242. food    the breaking probability after a shot (0-100)
  243.  
  244. And these two are for bows.
  245.  
  246. sp        the shooting speed (% of normal speed, 1-100)
  247. no_strength    player's strength or monster's level doesn't affect
  248.         the damage done by bow.
  249.  
  250. The other variables has their normal meanings.
  251.  
  252.   
  253. ------------------------------------------------------------------------------
  254. object creating objects, by peterm:
  255.  
  256. other_arch      the object to create
  257. connected       object will create when this is triggered
  258. hp              number of times to create before dissappearing
  259. lifesave        if 1, it will create the object every time it's triggered
  260. level           the level the created object will have
  261.  
  262. ------------------------------------------------------------------------------
  263. Player Movers, by peterm
  264.  
  265. Player movers are objects which move objects above them.  These objects
  266. must be alive.  They are directional, so players can be made to move in
  267. a pattern, and so can monsters.
  268.  
  269. Motion is involuntary.  Additionally, players or monsters can be paralyzed
  270. so that they MUST move along a chain of movers.
  271.  
  272. Multisquare monsters can be moved by movers, however enough space is required.
  273.  
  274. Here is the meaning of various fields:
  275.  
  276.  
  277. attacktype:  if nonzero, paralyzes anyone it moves (so they are forced to
  278.     move along a chain).  Default values is 0
  279.  
  280. maxsp:  the number of moves that the paralysis will rob the player of,
  281.         if unset, and attacktype is nonzero, this becomes 2.  By default,
  282.     it is zero.
  283.  
  284. maxhp:  if nonzero, flying objects will be moved also (default 0)
  285.  
  286. speed:  how fast a chain of these will move a player along (default -0.2)
  287.  
  288. sp:  the direction--if unset (0) motion is random.
  289.  
  290. level: if nonzero, players will be moved as well as monsters.  0 by default.
  291.  
  292. lifesave:  whether it can be used up, meaning is opposite, it may go away
  293. if lifesave is set.  default is not set.
  294.  
  295. hp:  if lifesave is set, the number of times (-1) it will move a player
  296.   (i.e., it will move someone hp+1 times before it vanishes.). default
  297.   0
  298.  
  299. Note from Mark:  Player Movers and Directors are seperate objects, even
  300. though they look and act similar.  Directors only do spells/missiles,
  301. however, while player movers only do living creatures (depending on how it
  302. is set)
  303.  
  304. ------------------------------------------------------------------------------
  305. Magical Walls  --  walls that cast spells
  306.  
  307. Magical walls are like other walls, except every now and then,
  308. they fire spells.
  309.  
  310. Magical walls can contain any spell.  However, some spells do not operate
  311. very successfully in them.  The only way to know is to test the spell you
  312. want to use with a wall.
  313.  
  314. Several types of magical walls are predefined for you in the archetypes, and
  315. can be found on a pick-map available in crossedit.
  316.  
  317. If you want a magical wall which is not already defined, all you need to do
  318. is choose one of the predefined walls, and modify the 'dam' variable.  The
  319. 'dam' variable contains the index of the spell.  See include/spellist.h to
  320. find your desired spell.
  321.  
  322. Meaning of archetype fields:
  323. field:        Meaning:
  324.  
  325. dam        spell the wall will cast
  326.  
  327. sp        integer direction the wall will cast the spell.  If 0,
  328.         the wall will cast the spell in random direction.
  329.  
  330. ac        armour class of wall
  331.  
  332. exp        experience value of the wall
  333.  
  334. speed        speed of the wall--you can fine-tune how fast the
  335.         wall will cast spells
  336.  
  337. alive        1 means it can be attacked, 0 means not
  338.  
  339. hp, maxhp    hit points
  340.  
  341. immune        immunity OR mask
  342.  
  343. type        for magical walls, this is 62
  344.  
  345. other_arch    obsolete now, means nothing
  346.  
  347. maxsp        has to do with turning walls.  The wall will turn
  348.         by 'maxsp' every time it fires, changing face.
  349.         To make a wall turn, it is sufficient to set this
  350.         to 1.  Setting it to 8 or any multiple thereof is
  351.         an exercise in futility.
  352.  
  353. level           The level the spell will cast spells at.  Level 1
  354.                 walls will cast spells at minimal strength.  Level 100
  355.                 walls will cast deadly spells.
  356.  
  357.  
  358. ------------------------------------------------------------------------------
  359. Containers:
  360.  
  361. container <xxx>         :  the maximum weight the container can hold
  362.  
  363. Str <xx>                :  reduces the weight of the objects in the container
  364.                            0 == no reduction,   100 = weightless
  365.  
  366. ------------------------------------------------------------------------------
  367. Monsters:
  368.  
  369. Pow: If the creature can cast spells, this is how many spell points
  370. are regenerated each move.
  371.  
  372. Con: Monsters regenerate this many hit points each move.  This is each
  373. time the monster has a move (some for Pow).  So two monsters with the
  374. same Con can regenerate at different rates if their speeds are different.
  375.  
  376. Wis: Determines how close a player needs to be before the creature wakes
  377. up.  This is done as a square, for reasons of speed.  Thus, if the wisdom is
  378. 11, any player that moves within the 11x11 square of the player will wake
  379. the monster up.  If the player has stealth, the size of this square is
  380. reduced in half plus 1.
  381.  
  382. maxsp:  Maximum spellpoints for monsters
  383.  
  384. SPECIAL NOTE (IMPORTANT!!!):
  385. The fields protected, vulnerable, immune, armour, wc and dam can be
  386. set in map files to customize monsters.  However, if that monster can
  387. be equipped with items, and actually equips some, these values will
  388. get reset back to those in the clone archetype (normal values.)  Thus,
  389. if you want to put a wizard in that does dam 50, make sure can_use_armour,
  390. and can_use_weapon are set back to 0.  Otherwise, when items are equipped,
  391. all the above fields will be reset to standard values.
  392. ------------------------------------------------------------------------------
  393. Mood Floors ("Brian Thomas" <thomas@astro.psu.edu>)
  394.  
  395. last_sp field is used to determine what will happen to the monster
  396. when the floor is activated:
  397.  
  398.         (based on value that last_sp takes):
  399.                 0:  'furious'   Makes all monsters aggressive
  400.                 1:  'angry'     As above but pets are unaffected
  401.                 2:  'calm'      Makes all monsters unaggressive
  402.                 3:  'sleep'     Puts all monsters to sleep
  403.                 4:  'charm'     Makes monster into a pet of person
  404.                                 who triggers the square. This setting
  405.                                 is not enabled for continous operation
  406.  
  407. ------------------------------------------------------------------------------
  408. Altars (and other objects that take sacrifices):
  409.  
  410. Note: This is not quite complete documentation, but is correct as far
  411. as it goes (0.92.1)
  412.  
  413. slaying:  What the sacrifice must match.  It either matches the archetype
  414. name (internal value only), object name, or slaying field of object.
  415. "money" is a special case - in this case, an exact name is not needed, any
  416. types of money will match.
  417.  
  418. food:  How many objects must be sacrificed.  If slaying is money, then the
  419. value of the money must be greater than the food value (ie, if food=200,
  420. then 200 sp, 20 gp, or 4 pp will all work.)
  421.  
  422. msg:  What to print when the altar is activated.
  423.  
  424. connected:  A link to another object to activate.
  425.  
  426. sp: Spell number to cast when activated.
  427.  
  428. level:  What level to cast the spell at.
  429.  
  430. hp:  If set, use hp to match to that object type.
  431.  
  432. Note:  For all sacrifice types, the number to activate the altar must be in
  433. one object.  Thus, in the above money example, 100 sp an 10 gp would not
  434. work.  Likewise, if the needed sacrifice was 2 swords, 1 normal sword and 1
  435. +1 sword would not work, even though 2 of either one would.
  436.  
  437. Quick summary of the different altars:
  438.  
  439. ------------------------------------------------------------------------------
  440. Triggers
  441.  
  442. TRIGGERS are slightly different than normal buttons/pedestals/whatever in
  443. that they reset after a short amount of time.  Thus, they can be used to
  444. open a door for a short amount of time.  Triggers use stats.wc as
  445. a temporary storage value to note activation.
  446.  
  447. TRIGGER_BUTTON: if weight on the button is greater than the weight value
  448. for the trigger, push a trigger.
  449.  
  450. TRIGGER_PEDESTAL:  IF a matching object is on top of the pedestal, then trigger
  451. a trigger.
  452.  
  453. TRIGGER_ALTAR: Takes a sacrifice, then pushes a trigger.
  454.  
  455. TRIGGER (handle):  Pushes a trigger.
  456.  
  457. Note:  At one time, there was a difference between triggers and buttons - they
  458. were considered different types for activation.  However, now they are all
  459. the same - a button can push a trigger, and vice versa.  And of course,
  460. triggers can activate other triggers, and the same for buttons.
  461.  
  462. ------------------------------------------------------------------------------
  463. Flags & specifications: (usage: flag value)
  464.  
  465. Note: the flags are case sensitive.
  466. G = generator. O = object.
  467.  
  468. Flag syntax             Value
  469. ===========             =====
  470. Object  <name>          name of O, internal refs only.
  471. name    <name>          name of O as seen in the game.
  472. race    <name>          race of O, internal.
  473. slaying <name>          Those O's with this race receives 2x damage.
  474.  
  475. other_arch <other obj>  which other O this G generates.
  476. More                    use between linked object defs.
  477.  
  478. anim
  479.  .                      which bitmaps to use in animation of the O.
  480.  .                      If TEAR_DOWN flag is set, this contains the different
  481.  .                      stages of being destroyed.
  482. face name        Name of the face (ie, food.111)
  483.  .
  484. mina
  485. end                     terminates definition of this O.
  486.  
  487. last_heal <no>          Internal use (for regaining hit-points)
  488. last_sp   <no>          Internal use (for regaining spell-points)
  489. last_eat  <no>          Internal use (for consuming food)
  490.  
  491. speed     <no>          speed of O.  A negative number means that speed_left
  492.                         will be randomized when the object is loaded.
  493. speed_left <no>         speed of O remaining, internal.
  494. slow_move <no>          Slow-down factor for player walking on this O.
  495. face <bmap no>           bitmap first drawn for O.
  496. Str,Dex,Con,
  497. Wis,Cha,Int <no>        default ability for O.
  498. hp,maxhp,sp,maxsp <no>  default value for O hitpoints, spellpoints.
  499. maxsp                   In main.c:fire() which arrowtype to use
  500.                         Number equal to to the arrows type definition.
  501.  
  502. exp <no>                Xp gained for killing O.
  503. food <no>               nutrition value for O. *DANGEROUS* as it's also
  504.                         used to contain internal values for non-edible
  505.                         objects. This should be changed in future.
  506. dam,wc,ac <no>          default damage, weaponclass, armorclass. 
  507.                         dam 0 gives a 'friendly' monster ;)
  508. wc                      main.c:move_gate(). Is used by gates to indicate in 
  509.                         which position they are.
  510. x,y <no>                relative coords for bmap when using large objects.
  511.                         x=y=0 is default, x=1 is second bmap in first row etc.
  512. nrof <no>               No. of O:s.  0 means that objects of this type
  513.                         are not to be joined/split (it's a lone object).
  514. level <no>              O:s level.
  515. direction               In which direction (1=north, 8=north-west) this O is
  516.                         moving (flying).
  517.  
  518. type <no>               the object as defined in 'defines.h'
  519. material <no>           the sum of materials in this O. (see materials.)
  520. value <no>              the value for this O.
  521. weight <no>             the weight for this O.
  522. carrying                sum of the weight of objects within this object.
  523.  
  524. immune <no>             attack immunity for this O. (no dam) (see attacks)
  525. protected <no>          protection for this O. (1/2 dam) (weaker than immunity)
  526. attacktype <no>         type of attack from O. (see attacks)
  527. vulnerable <no>         special vulnerability of O. (2x dam) (see attacks)
  528.  
  529. invisible <1>           set if O is invisible.
  530. magic <no>              magic modifier of O. (bracers +3 has magic 3)
  531. state                   internal.  Used when animating the object
  532. alive <1>               set if O is alive (can be attacked).
  533. applied                 set if object is readied/worn/etc.
  534. unpaid                  set if object is unpaid (internal)
  535. need_an <1>             object must be prepended with "an" instead of "a".
  536. need_ie <1>             In plural, object must be appended by "ie"
  537.                         instead of "y"
  538.  
  539. no_pick <1>             set if O can't be taken.
  540. no_pass <1>             set if O can't be passed. (eg, a closed door)
  541. walk_on <1>             O is applied by anything walking onto it.
  542. walk_off <1>            O is applied by anything walking off it.
  543. fly_on <1>              O is applied by anything flying onto it
  544. fly_off <1>             O is applied by anything flying off it.
  545. is_animated <1>         set if O is animated.
  546.  
  547. flying <1>              set if O is flying (used in fly_on/fly_off).
  548. monster <1>             set if O is a monster.
  549. friendly                Not used yet.
  550. generator <1>           set if O is a generator.
  551. auto_apply <1>          O is applied when it is loaded (for instance, some
  552.                         chests open automatically when the map is loaded)
  553. treasure <1>            not used yet.
  554.  
  555. apply_once <1>          not used yet
  556. see_invisible <1>       set if O can see invisible player.
  557. can_roll <1>            set if O can be rolled.
  558. is_turning <1>          set if O can turn sideways.
  559. is_turnable <1>         set if O can be turned 'automagically'
  560.  
  561. is_used_up <1>          bizarre. O is used up after created, eg an explosion.
  562. identified <1>          not used yet (looking forward to adding it -Frank 8)
  563. reflecting <1>          set if O is reflective.
  564. changing <1>            set if O will change appearance.
  565. splitting <1>           set if O will divide.
  566. hitback <1>             set if O hits when being hit.
  567.  
  568. blocksview <1>          set if O blocks line of sight.
  569. undead <1>              set if O is undead.
  570. scared <1>              internal (O is running away from players right now)
  571. unaggressive <1>        internal (not used yet)
  572.  
  573. color_fg <no>           foreground color of O. Remember to set face/anim first!
  574. color_bg <no>           background -"-         - "" -
  575. reflect_missile <1>     set if O throws back missiles.
  576. reflect_spell <1>       set if O throws back spells (some).
  577. no_magic <1>            set if O totally resists magic (*use with care*)
  578.  
  579. tear_down <1>           set if O can be torn down (using animations and hp).
  580. run_away <no %>         percentile of hp left which causes monster to flee.
  581.  
  582. pass_thru <1>           set if O can be passed thru by objects <below>.
  583. can_pass_thru <1>       set if O can pass thru objects <above>
  584. pick_up <value>         Which items monster will pick up (see pickup (above))
  585.  
  586.  
  587.  
  588.  
  589.  
  590. HOW TO CREATE NEW ARCHETYPES AND BITMAPS:
  591.  
  592.  0) Figure out which directory/category the object will belong to.  This
  593.     will determine the appropriate location for it inside the 'arch'
  594.     directory.  For objects with many animations or that are very large,
  595.     you may want to make a new subdirectory.
  596.  1) create a bitmap.  It must be dividable by 24 in both height and width.
  597.  2) create additional bitmaps if you want animation.
  598.  3) split the bitmaps up into 24x24 bitmaps, if your bitmaps are larger.
  599.     (you can use the script "splitxbm" which is included below).
  600.  4) If possible, also create an X Pixmap file for each bitmap.  The
  601.     name of each XPM file is the same as the bitmap file, with .xpm
  602.     appended.
  603.  5) Create an archetype entry.  The file should be called
  604.     object.arc, where object is whatever the new object is.
  605.     This is by far the most complicated step.  First read "crossfire.doc" for
  606.     an introduction on how to create archetypes.
  607.     Look at other similary archetypes to see how they have been done.
  608.     If you only made one 24x24 bitmap, you will only need one archetype, but
  609.     if you made a larger bitmap which is cut down to several 24x24 bitmaps,
  610.     you will need to use "linked" archetypes.  How to do this is not
  611.     documented yet, but try to study the other linked archetypes.
  612.     If you have several bitmaps that should be animated, use the
  613.     "anim" feature described in "crossfire.doc".
  614.  
  615. TREASURES:
  616. ==========
  617.  
  618. The treasures are kept in LIBDIR/treasures.  Their format is:
  619.  
  620. treasure <name>
  621.   <item>
  622.   more
  623.   <item>
  624.   end
  625.  
  626. Also, 'treasure' above can instead be 'treasureone'.  This means
  627. that only 1 item on that list will be generated.  The chance for
  628. all objects on that list are summed together, and one is then generated.
  629.  
  630. And the format for an item is:
  631.  
  632.   arch <name>
  633.   nrof <n (random 1 to n items generated)>
  634.   magic <max-magic>
  635.   chance <1-100%>
  636.   yes
  637.     <item>
  638.   no
  639.     <item>
  640.   end (or "more", if this is not the last element)
  641.  
  642. If "magic" or "nrof" is omitted, it is set to 0.
  643. If "chance" is ommitted, it is set to 100%.
  644. "yes" tells what can be generated if this item was generated.
  645. "no" tells what can be generated if this item was not generated.
  646. "yes" and "no" can of course be omitted.
  647.  
  648. Note: the 'no' and 'yes' fields are meaningless in treasureone
  649. treasurelists.
  650.  
  651. Also, instead of an item, a list to transfer to can be used instead.
  652. The format is the same as for an object, but instead 'list <list>' is
  653. used instead of 'arch <name>'.
  654.  
  655. For list transitions, the chance, yes and no fields have the
  656. same meaning.  'magic' is used to determine the difficulty required
  657. to transfer to the new list.
  658.  
  659. If the list is of type 'treasureone', and a list transition fails,
  660. what happens next is determined by the 'nrof' field.  If it is zero,
  661. no object is generated.  If 'nrof' is one, than another attempt is
  662. made to generate an item (or list transition) from that treasurelist.  There
  663. is a maximum number of attempts that can be made.
  664.  
  665. Also, a reserved list name of 'NONE' is allowed.  This means that no
  666. item should be generated (of relevence only on treasureone lists.)
  667.  
  668. To use such a treasure, just put "randomitem <name>" into any
  669. archetype in the archetype-file.  Random treasure will then be generated
  670. whenever such a monster is generated by generator, or when a map
  671. containing such <monsters> is loaded for the first time.
  672.  
  673. ------------------------------------------------------------------------------
  674. NPC's and their life:
  675. =====================
  676.  
  677. An NPC can have any combination of the following programs (flags):
  678.  
  679. FLAGS: (They are checked in the following order:)
  680.   - sleep               (will stand still until woken)
  681.   - scared              (will run away)
  682.   - random_movement     (move randomly)
  683.   - friendly            (will attack enemies of the nearest player)
  684.   - unaggressive        (don't attack until attacked)
  685.   - stand_still         (don't ever move)
  686.  
  687. sleep + (any)           = sleep until woken, then do any of the other things...
  688. neutral + random_movement = move randomly around all the time.
  689. neutral (alone)         = stand still until attacked, then attack and move.
  690. stand_still + (any)     = do anything except moveing
  691.  
  692. In addition it can have run_away set to which percentage of full
  693. hit-points the npc will run away at.
  694.  
  695. And then there is the NPC features made by Karl Holland:
  696.  
  697. Set the variable attack_type to one of the below (cut from define.h):
  698. /*****************************************************************************/
  699. /* Monster Movements added by kholland@sunlab.cit.cornell.edu                 /
  700. /*****************************************************************************/
  701. /* if your monsters start acting wierd, mail me                              */
  702. /*****************************************************************************/
  703. /* the following definitions are for the attack_movement variable in monsters */
  704. /* if the attack_variable movement is left out of the monster archetype, or is*/
  705. /* set to zero                                                                */
  706. /* the standard mode of movement from previous versions of crossfire will be  */
  707. /* used. the upper four bits of movement data are not in effect when the monst*/
  708. /* er has an enemy. these should only be used for non agressive monsters.     */
  709. /* to program a monsters movement add the attack movement numbers to the movem*/
  710. /* ment numbers example a monster that moves in a circle until 
  711.                    /* attack from a distance - good for missile users only */
  712. #define RUNATT  2  /* run but attack if player catches up to object        */
  713. #define HITRUN  3  /* run to then hit player then run away cyclicly        */
  714. #define WAITATT 4  /* wait for player to approach then hit, move if hit    */
  715. #define RUSH    5  /* Rush toward player blindly, similiar to dumb monster */
  716. #define ALLRUN  6  /* always run never attack good for sim. of weak player */
  717. #define DISTHIT 7  /* attack from a distance if hit as recommended by Frank*/
  718. #define WAIT2   8  /* monster does not try to move towards player if far   */
  719.                    /* maintains comfortable distance                       */
  720. #define PETMOVE 16 /* if the upper four bits of move_type / attack_movement*/
  721.                    /* are set to this number, the monster follows a player */
  722.                    /* until the owner calls it back or off                 */
  723.                    /* player followed denoted by 0b->owner                 */
  724.                    /* the monster will try to attack whatever the player is*/
  725.                    /* attacking, and will continue to do so until the owner*/
  726.                    /* calls off the monster - a key command will be        */
  727.                    /* inserted to do so                                    */
  728. #define CIRCLE1 32 /* if the upper four bits of move_type / attack_movement*/
  729.                    /* are set to this number, the monster will move in a   */
  730.                    /* circle until it is attacked, or the enemy field is   */
  731.                    /* set, this is good for non-aggressive monsters and NPC*/ 
  732. #define CIRCLE2 48 /* same as above but a larger circle is used            */
  733. #define PACEH 64   /* The Monster will pace back and forth until attacked  */
  734.                    /* this is HORIZONTAL movement                          */
  735. #define PACEH2  80 /* the monster will pace as above but the length of the */
  736.                    /* pace area is longer and the monster stops before     */
  737.                    /* changing directions                                  */
  738.                    /* this is HORIZONTAL movement                          */
  739. #define RANDO   96 /* the monster will go in a random direction until      */
  740.                    /* it is stopped by an obstacle, then it chooses another*/
  741.                    /* direction.                                           */
  742. #define RANDO2 112 /* constantly move in a different random direction      */
  743. #define PACEV 128  /* The Monster will pace back and forth until attacked  */
  744.                    /* this is VERTICAL movement                            */
  745. #define PACEV2 144 /* the monster will pace as above but the length of the */
  746.                    /* pace area is longer and the monster stops before     */
  747.                    /* changing directions                                  */
  748.                    /* this is VERTICAL movement                            */
  749.  
  750. The message structure in a monster can contain:
  751. @match <key>|<key>[...]
  752.   [text]
  753. [...]
  754.  
  755.  
  756.  
  757. This identifies what the monster will say if talked to with a text
  758. which matches any keys.
  759. A key contaning '*' will match anything.
  760.  
  761. An example of usage:
  762. @match hello|hi
  763. Welcome, good friend!
  764. @match bye
  765. Goodbye!
  766. @match *
  767. What did you say?
  768.  
  769. Obviously this feature can be expanded extensively, so expect it
  770. to evolve till the next version.
  771.  
  772. ------------------------------------------------------------------------------
  773. Misc change description:
  774.  
  775.  The following area describes various comments about various pieces of
  776. code.  In general, the information describes a basic idea of how things
  777. work.  The following may not really be necessary, but I figure that it is
  778. probably worth saving, and this seemed to be as good as place as any.
  779.  
  780. LIGHTING CODE (by Brian Thomas):
  781.                - fast calculation of lighting. For players los (line- of
  782.         sight)is calculated from a linked list of nearby lights.
  783.         For monsters, no los is calculated, rather a modified
  784.         check_wakeup routine is used to see if they will
  785.         follow/attack players.  Monsters with can_see_in_dark act
  786.         normally in dark areas.
  787.                 
  788.                 - New attacktype -AT_BLIND. This is a pretty severe penalty
  789.         for monsters and players alike. Players cant see any square
  790.         but thier own, monsters can only attack/follow players who
  791.         are in an adjacent square. Need to make the monsters stumble
  792.         around when no player is near, rather than the current way
  793.         in which they stand around waiting to get "ace'd". Undead
  794.         cannot be blinded, nor should be effected by darkness. For
  795.         other monsters, if they have immunity to blindness or can
  796.         see invisible, they are uneffected by AT_BLIND attacks.
  797.  
  798.                 - New spells. Some magician, some clerical. They work, but
  799.         may need to be adjusted for playbalance. Normal spells
  800.         available include: "light", "darkness", "sunspear", "faery
  801.         fire" and "dark vision". All spells (but darkvision) work
  802.         (do something) whether the lighting code is used or not. 
  803.  
  804.                 - Modified archetypes and artifacts list to encompass changes
  805.         to the code from lighting. Also, some new archs instroduced,
  806.         namely "flint and steel" for lighting stuff on fire and
  807.         "torch" a source of light.
  808.                 
  809.